/*!
 * Copyright &copy; 2012-2013 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */

$(document).ready(function() {
	$("input[name=id]").each(function(){
		var articleSelect = null;
		if (top.mainFrame.cmsMainFrame){
			articleSelect = top.mainFrame.cmsMainFrame.articleSelect;
		}else{
			articleSelect = top.mainFrame.articleSelect;
		}
		for (var i=0; i<articleSelect.length; i++){
			if (articleSelect[i][0]==$(this).val()){
				this.checked = true;
			}
		}
		$(this).click(function(){
			var id = $(this).val(), title = $(this).attr("title");
			if (top.mainFrame.cmsMainFrame){
				top.mainFrame.cmsMainFrame.articleSelectAddOrDel(id, title);
			}else{
				top.mainFrame.articleSelectAddOrDel(id, title);
			}
		});
	});
});

function view(href){
	top.$.jBox.open('iframe:'+href,'查看文章',$(top.document).width()-220,$(top.document).height()-120,{
		buttons:{"关闭":true},
		loaded:function(h){
			$(".jbox-content", top.document).css("overflow-y","hidden");
			$(".nav,.form-actions,[class=btn]", h.find("iframe").contents()).hide();
		}
	});
	return false;
}

function page(n,s){
	$("#pageNo").val(n);
	$("#pageSize").val(s);
	$("#searchForm").submit();
	return false;
}

